package com.woniu.producer;

import com.woniu.entity.RabbitmqConst;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TopicProducer {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    public void send(String routeKey,String msg){
        rabbitTemplate.convertAndSend(RabbitmqConst.TOPIC_EXCHANGE,routeKey,msg);
    }

}
